//
//  YJLocationTool.h
//  YaJi
//
//  Created by YiGuo on 2018/11/15.

//

#import <Foundation/Foundation.h>


typedef NS_ENUM(NSInteger, YJLocationBlockType) {
    YJLocationBlockTypeLogAndLat = 1,
    YJLocationBlockTypeAreaName
};

@protocol YJLocationToolDelegate <NSObject>
-(void)didFinishLocationsCity:(NSString *)city error:(NSError *)error;
@end


typedef void(^LocationToolSuccessBlock)(NSString * longitude, NSString * latitude, NSString *cityNmae);

typedef void(^LocationToolErrBlock)(NSError *error);

typedef void(^LocationToolBlock)(NSString * longitude, NSString * latitude, NSString *cityNmae, NSError *err);

typedef void(^LocationToolAreaNameBlock)(NSString * provinceName, NSString * cityName,  NSString *districtName, NSError *err);

@interface YJLocationTool : NSObject
//开始定位
-(BOOL)startLocation;



@property (nonatomic ,weak) id <YJLocationToolDelegate> delegate;

@property (nonatomic, copy) LocationToolBlock loctionBlock;
@property (nonatomic, copy) LocationToolAreaNameBlock areaNameBlock;

@property (nonatomic, assign) YJLocationBlockType blockType;

+(instancetype)shareinstance;
+(NSDictionary *)_yjGetWANIP;
//-(void)startLocationLocationToolSuccessBlock:(LocationToolSuccessBlock)successBlock locationToolErrBlock:(LocationToolErrBlock)errorBlock;
@end
